package com.greensam.pixelengine.pojo.emuns;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Ma Chengrui
 * @since 2025/9/16 14:05
 */
@Getter
@AllArgsConstructor
public enum PicturePixelEnum {

    SMALL(0, "小", 0, 500 * 500),
    MEDIUM(1, "中", 500 * 500 + 1, 1000 * 1000),
    LARGE(2, "大", 1000 * 1000 + 1, 2000 * 2000),
    HUGE(3, "超大", 2000 * 2000 + 1, Integer.MAX_VALUE),
    CUSTOM(4, "自定义", null, null)

    ;

    private final Integer value;
    private final String description;
    private final Integer minPixel;
    private final Integer maxPixel;

    public static PicturePixelEnum getEnumByValue(Integer value) {
        for (PicturePixelEnum pixelEnum : PicturePixelEnum.values()) {
            if (pixelEnum.value.equals(value)) {
                return pixelEnum;
            }
        }
        return null;
    }
}
